PROGRAM = tmiss_linux

CC ?= gcc
CFLAGS ?= `mysql_config --cflags` -std=c99 -D_XOPEN_SOURCE=600
LDLAGS ?= 
LIBS ?= `mysql_config --libs`

WARNERROR ?= no

ifeq ($(WARNERROR), yes)
CFLAGS += -Werror
endif

OBJS = $(PROGRAM).o

all: $(PROGRAM)

$(PROGRAM): $(OBJS)
	$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)

%.o: %.c
	$(CC) $(CFLAGS) -o $@ -c $<

clean:
	rm -f $(PROGRAM) *.o *.d

.PHONY: all clean
